<!DOCTYPE html>
<html>
	<head>
		<title>js自动运行</title>
	</head>
	<body>
	</body>
	<script type="text/javascript">
		window.onload = function (){
			var initial = function (){
				alert("文档加载完毕,js函数自动执行");
			}();
		}
	</script>
</html>